<?
require_once('config.php');
$action = getValue('action','str','POST');
$arr_cat = Cate::getListCat();
if($action == 'submit'){
   $pla_name = getValue('pla_name','str','POST','');
   $cat_id = getValue('cat_id','int','POST');
   Playlist::addPla($pla_name,$cat_id);
   echo '<span style="color: #01B42C;font-size: 14px;font-weight: bold;">Thêm thành công</span>';
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Thêm mới <?=$moduol_name?></title>
   <?=$css_global?>
   <?=$js_global?>
</head>
<div class="row-fluid">
   <div class="head">
      <div class="isw-grid"></div>
      <h1>Thêm mới <?=$moduol_name?></h1>      
      <div class="reload_tab" title="Reload"></div>                         
      <div class="clear"></div>
   </div>
   <div class="block-fluid">
      <form class="form-horizontal" name="add" action="" method="POST" enctype="multipart/form-data"  onsubmit="">
         <input type="hidden" name="action" value="submit" />
         <fieldset>
            <div class="control-group">
               <label class="control-label" for="input01">Tên playlist</label>
               <div class="controls">
						<input type="text" class="input-xlarge tooltip-right span8" id="pla_name" name="pla_name" title="Tên playlist"/>
					</div>
            </div>
            <?php 
               if(count($arr_cat) > 0){?>
                  <div class="control-group">
                     <label class="control-label" for="input01">Thể loại</label>
                     <div class="controls">
      						<select id="cat_id" name="cat_id">
                           <option value="0">Không chọn</option>
                           <?php
                              foreach($arr_cat as $value){?>
                                 <option value="<?=$value['cat_id']?>"><?=$value['cat_name']?></option>
                              <?php }
                            ?>
                        </select>
      					</div>
                  </div>
               <?php }
            ?>
            <div class="form-actions">
					<button type="submit" class="btn btn-info">Thêm mới</button>
					<button type="reset"  class="btn btn-warning">Làm lại</button>
				</div>
         </fieldset>
      </form>
   </div> 
</div>